package cz.muni.fi.pa165.languageschool.service;

import cz.muni.fi.pa165.languageschool.dto.LectureTO;
import cz.muni.fi.pa165.languageschool.dto.LecturerTO;
import cz.muni.fi.pa165.languageschool.dto.StudentTO;
import java.util.Collection;
import java.util.List;

/**
 * Interface of service for managing Lecture entities
 *
 * @author Marketa Trachtova (255498) marketa.tr(at)gmail.com, Michal Fučík
 * (395624) michal.fuca.fucik(at)gmail.com
 */
public interface LectureService {

    /**
     * Create a new lecture. Lecture cannot be null
     *
     * @param lecture The lecture entity. Lecture cannot be null
     */
    void createLecture(LectureTO lecture);

    /**
     * Fetches all lectures from the database
     *
     * @return collection of lectures
     */
    Collection<LectureTO> getAllLectures();

    /**
     * Get lecture by lecture id. Lecture cannot be null
     *
     * @param id Id cannot be null
     */
    LectureTO getLecture(Long id);

    /**
     * Updates lecture entity within the database
     *
     * @param lecture
     */
    void updateLecture(LectureTO lecture);

    /**
     * Removes given entity from the database
     *
     * @param lecture
     */
    void deleteLecture(LectureTO lecture);

    /**
     * Fetches lecture's lecturer
     *
     * @param lecture
     * @return lecturer
     */
    LecturerTO getLecturesLecturer(LectureTO lecture);

    /**
     * Attaches lecturer to appropriate lecture
     *
     * @param lectureId
     * @param lecturerTO
     */
    void setLecturerToLecture(Long lectureId, LecturerTO lrr);

    /**
     * Returns enrolled students of given Lecture (straight from database)
     *
     * @param lto
     * @return a list of StudentTO
     */
    List<StudentTO> getEnrolledStudents(LectureTO lto);

    /**
     * Sets enrolled student for Lecture specified by given identifier
     *
     * @param id Lecture id
     * @param sts
     */
    void setEnrolledStudents(Long id, List<StudentTO> sts);
    
    /**
     * Enrolls student for given lecture
     * @param lecture
     * @param student 
     */
    void enrollStudent(LectureTO lecture, StudentTO student);
    
    /**
     * Disenrolls student from given lecture
     * @param lecture
     * @param student 
     */
    void disenrollStudent(LectureTO lecture, StudentTO student);
}
